package com.linjuke.childay.util;

public class ConvertUtil {
	
	public static int toInt(String input, int defaultValue) {
		try {
			return Integer.parseInt(input);
		} catch (Exception e) {
			return defaultValue;
		}
	}
	
	public static long toLong(String input, long defaultValue) {
		try {
			return Long.parseLong(input);
		} catch (Exception e) {
			return defaultValue;
		}
	}
	
	public static double toDouble(String input, double defaultValue) {
		try {
			return Double.parseDouble(input);
		} catch (Exception e) {
			return defaultValue;
		}
	}

}
